#ifndef _GAMEEVENT_H
#define _GAMEEVENT_H

#pragma once
#include "ByteBuffer.h"
#include "Tokenizer.h"
#include <string>
#include <list>

using namespace std;

enum EventType
{
	EVENT_UNDEFINED,
	EVENT_GAME_SESSION_BEGIN,
	EVENT_GAME_SESSION_END,
	EVENT_GAME_SESSION_CLIENTSERVER,
	EVENT_MOVE
};

class GameEvent
{
public:
	GameEvent(void);
	GameEvent(EventType, string);
	virtual ~GameEvent(void);
	EventType getType(void);
	static EventType getType(int);
	void setName(string name);
	string getName(void);
	string getSource(void);
	void setX(int);
	int getX(void);
	void setY(int);
	int getY(void);
	void setAngle(int);
	int getAngle(void);
	void setCode(int);
	int getCode(void);
	void setId(int);
	int getId(void);
	list<GameEvent*>* unmarshalList(ByteBuffer* b);
	void setType(EventType e);
	virtual ByteBuffer* marshal(void);
	virtual void unmarshal(ByteBuffer*);
	virtual string toString(void);
	void setSource(string s);
	list<ByteBuffer*>* getBulletMoves();

protected:
	EventType type;
	string name;
	string source;
	list<ByteBuffer*>* bulletMoves;
	int code;
	int id;
	int angle;
	int speed;
	int x_coordinate;
	int y_coordinate;
};

#endif;
